﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace park.System_Manager
{
    public partial class AuthorityRoles : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string method = Request.Params["method"];
                if (!string.IsNullOrEmpty(method))
                {

                    switch (method)
                    {
                        case "RoleList":
                            {
                               RoleList();
                                break;
                            }
                        case "DelRole":
                            {
                                DeleteRole();
                                break;
                            }
                    }
                   
                }
            }
        }

        private void DeleteRole()
        {
            string id = Request.Params["id"];

            cn.linkit.epark.ServiceList sl = new cn.linkit.epark.ServiceList();
           // bool flag = sl.DeleteRole(id);
            bool flag = true;

            Response.Write("{" + string.Format("\"isSuccess\":\"{0}\"", flag.ToString().ToLower()) + "}");
            Response.End();
        }

        private void RoleList()
        {
            string json = string.Empty;

            cn.linkit.epark.ServiceList sl = new cn.linkit.epark.ServiceList();

            // json = sl.RoleList();

            json = "{\"ListRoles\":[{\"id\": \"1\",\"name\": \"角色1\",\"description\": \"描述\"},{\"id\": \"2\",\"name\": \"角色2\",\"description\": \"描述\"}],\"RowsCount\":\"32\"}";
 Response.Write(json);
                    Response.End();

        }
    }
}